<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>


<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <jsp:include page="/WEB-INF/jsp/include/head.jsp"/>


</head>
<style>
    .cont {
        display: block;
        background-color: #f1f3fa;
        padding: 6px;
        margin-bottom: 7px;

    }

    .bs-callout {
        padding: 10px;
        margin: 0px 20px 20px 0px;
        border: 1px solid #d6e5f5;
        border-left-width: 5px;
        border-radius: 3px;
        min-height: 400px;
    }

    .bs-callout-warning {
        border-left-color: #4b9c71;
    }

    .bs-callout-danger {
        border-left-color: #ce4844;
    }

    .bs-callout-info {
        border-left-color: #1b809e;
    }

    .portlet-body {
        margin-left: 15px;
    }

    a {
        color: #0170da;
        text-shadow: none;
        text-decoration: none;
    }

    a:hover {
        color: #0135ac;
        text-decoration: none;
        cursor: pointer;
    }
</style>

<body>
<ol class="breadcrumb">
    <li><strong>当前位置： </strong>首页</li>
    <li class="active">待办与通知</li>
</ol>
<shiro:hasPermission name="expertInfo:expertEdit:default">
    <div class="col-md-12">
        <div class="alert alert-warning alert-dismissible fade in" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
                    aria-hidden="true">×</span></button>
            提示：页面右上方“业务系统”中的系统可以免密码登录。
        </div>
    </div>
</shiro:hasPermission>
<div class="col-md-4 col-sm-4 ">
    <div class=" bs-callout  bs-callout-danger">
        <div class="portlet-title">
            <h4 style="color:#ce4844 "><span class="glyphicon glyphicon-bell"></span>&nbsp;&nbsp;待办事项</h4>
        </div>
        <div id="warn_body" class="portlet-body" style="height: auto;">

        </div>
    </div>
</div>

<div class="col-md-4 col-sm-4  ">
    <div class=" bs-callout  bs-callout-warning">
        <div class="portlet-title">
            <h4 style="color:  #4b9c71 ;display: inline-block"><span class="glyphicon glyphicon-volume-up"></span>&nbsp;&nbsp;通知公告
            </h4>
            <div style="display: inline-block;float: right">
                <small><a href="notice/noticeInfoSelect/index">更 多 >>></a></small>
            </div>
        </div>
        <div id="notice_body" class="portlet-body" style="height: auto;">
        </div>
    </div>
</div>


<div class="col-md-4 col-sm-4  ">
    <div class=" bs-callout  bs-callout-info">
        <div class="portlet-title">
            <h4 style="color:  #1b809e ;display: inline-block"><span class="glyphicon glyphicon-info-sign"></span>&nbsp;&nbsp;系统信息
            </h4>
            <div style="display: inline-block;float: right">
                <small><a href="expertInfo/expertSeeCheckResult/index">更 多 >>></a></small>
            </div>
        </div>
        <div id="info_Body" class="portlet-body" style="height: auto;">
        </div>
    </div>
</div>

<jsp:include page="/WEB-INF/jsp/include/footer.jsp"/>

<script>
    function createCell(icon, text, tar_url) {
        var str = '<div >' +
            '<i class="' + icon + '"></i>&nbsp;&nbsp;' +
            '<span>' + text + '</span>' +
            '</div>';
        if (tar_url != '#') {
            str = '<a class="cont"  href="' + tar_url + '"  >' +
                '<div >' +
                '<i class="' + icon + '"></i>&nbsp;&nbsp;' +
                '<span>' + text + '</span>' +
                '</div>' +
                '</a>';
        }
        return str;
    }

    function getInfo(url, varBody) {
        $.ajax({
            type: "GET",
            url: url,
            success: function (data) {
                if (data.status == '1') {
                    varBody.append(createCell('glyphicon glyphicon-bell', data.data.info, data.data.url));
                }
            }
        });
    }
    ;

    $(function () {
        var warnBody = $("#warn_body");
        var noticeBody = $("#notice_body");
        var infoBody = $("#info_Body");

        <shiro:hasPermission name="expertInfo:certificateWarn:default">
        getInfo('expertInfo/certificateWarn/welcomeTips', warnBody);
        </shiro:hasPermission>

        <shiro:hasPermission name="expertInfo:adminCheck:default">
        getInfo('expertInfo/adminCheck/welcomeTips', warnBody);
        </shiro:hasPermission>

        <shiro:hasPermission name="business:companyAssess:default">
        getInfo('business/companyAssess/welcomeTips', warnBody);
        </shiro:hasPermission>

        <shiro:hasPermission name="business:fundCheck:default">
        getInfo('business/fundCheck/welcomeTips', warnBody);
        </shiro:hasPermission>

        <shiro:hasPermission name="business:fundEntry:default">
        getInfo('business/fundEntry/welcomeTips', warnBody);
        </shiro:hasPermission>

        <shiro:hasPermission name="business:inspectorAssess:default">
        getInfo('business/inspectorAssess/welcomeTips', warnBody);
        </shiro:hasPermission>

        <shiro:hasPermission name="business:managerAssess:default">
        getInfo('business/managerAssess/welcomeTips', warnBody);
        </shiro:hasPermission>

        <shiro:hasPermission name="business:observerAssess:default">
        getInfo('business/observerAssess/welcomeTips', warnBody);
        </shiro:hasPermission>

        <shiro:hasPermission name="business:observerReport:default">
        getInfo('business/observerReport/welcomeTips', warnBody);
        </shiro:hasPermission>

        <shiro:hasPermission name="expertInfo:checkNotEnough:default">
        getInfo('expertInfo/checkNotEnough/welcomeTips', warnBody);
        </shiro:hasPermission>


        <shiro:hasPermission name="expertInfo:leader2Check:default">
        getInfo('expertInfo/leader2Check/welcomeTips', warnBody);
        </shiro:hasPermission>

        <shiro:hasPermission name="expertInfo:leader1Check:default">
        getInfo('expertInfo/leader1Check/welcomeTips', warnBody);
        </shiro:hasPermission>

        <shiro:hasPermission name="expertInfo:handleLeaderCheck:default">
        getInfo('expertInfo/handleLeaderCheck/welcomeTips', warnBody);
        </shiro:hasPermission>



        <shiro:hasPermission name="notice:noticeInfoSelect:default">
        $.ajax({
            type: "GET",
            url: 'notice/noticeInfoSelect/select?offset=0&limit=7',
            success: function (data) {
                if (data.total > 0) {
                    for (var i = 0; i < data.rows.length; i++) {
                        var j = data.rows[i];
                        noticeBody.append(createCell('glyphicon glyphicon-volume-up', j.name, 'notice/noticeInfoManager/detail?id=' + j.id));
                    }
                }
            }
        });
        </shiro:hasPermission>

        <shiro:hasPermission name="expertInfo:expertSeeCheckResult:default">
        $.ajax({
            type: "GET",
            url: 'expertInfo/expertSeeCheckResult/select?offset=0&limit=7',
            data: {},
            success: function (data) {
                if (data.total > 0) {
                    for (var i = 0; i < data.rows.length; i++) {
                        var j = data.rows[i];
                        var s = $.sysPlugin.ifElse(j.tableName, entityName) + " " + $.sysPlugin.ifElse(j.operateType, $.sysPlugin.enumeration.operationType) + " 申请已被审核";
                        infoBody.append(createCell('glyphicon glyphicon-volume-up', s, "expertInfo/expertSeeCheckResult/index"));
                    }
                }
            }
        });
        </shiro:hasPermission>

    });

    var entityName = {
        "EMS_EXPERT_BASE": "基本信息",
        "EMS_EXPERT_COMPANY": "工作单位",
        "EMS_EXPERT_CERTIFICATE": "资质证书",
        "EMS_EXPERT_MAJOR": "从事专业",
        "EMS_EXPERT_WORK": "工作经历",
        "EMS_EXPERT_TRAIN": "培训经历",
        "EMS_EXPERT_EDUCATION": "教育经历",
        "EMS_EXPERT_REVIEW": "审查/评审经历"
    };


</script>


</body>
</html>
